package huoye.shops.huoye.operation.activity;

import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.codeideology.android.AXIFragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import huoye.shops.R;
import huoye.shops.base.BaseActivity;
import huoye.shops.huoye.home.fragment.HomeDataShowFragment;
import huoye.shops.huoye.operation.fragment.DiscountCancelFragment;
import huoye.shops.huoye.operation.fragment.StatisticsFragment;
import huoye.shops.utils.StockUtils;

public class DiscountCancelActivity extends BaseActivity {

    @BindView(R.id.base_toolbar_tl)
    TabLayout tl;
    @BindView(R.id.base_toolbar_vp)
    ViewPager vp;


    List<Fragment> fragments = new ArrayList<>();
    List<String> titles = new ArrayList<>();
    AXIFragmentPagerAdapter myFragmentPagerAdapter;

    @Override
    protected int getContentViewId() {
        return R.layout.activity_discount_cancel;
    }

    @Override
    protected void initView(@Nullable Bundle bundle) {
        setTitle("折扣核销");


        fragments.add(DiscountCancelFragment.getInstan(DiscountCancelFragment.TYPE_DISCOUNT_CANCEL_NO));
        fragments.add(DiscountCancelFragment.getInstan(DiscountCancelFragment.TYPE_DISCOUNT_CANCEL_YES));

        titles.add(getString(R.string.operation_discount_cancel_no));
        titles.add(getString(R.string.operation_discount_cancel_yes));



        StockUtils.reflex(tl);
        myFragmentPagerAdapter = new AXIFragmentPagerAdapter(getSupportFragmentManager(),fragments, titles);
        vp.setAdapter(myFragmentPagerAdapter);
        vp.setOffscreenPageLimit(fragments.size());
        tl.setupWithViewPager(vp);

    }

    String mNumber;
    public  void  setNoDiscountCanceNumber(String number){
            this.mNumber = number;
    }
}
